![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
democracyos-bounds
Advanced tools
Mixin for checking if value is inside or outside of bounds You can use Bounds
for any objects for
which you can define compare function (dates, vectors etc.)
In addition to regular range checking Bounds
supports reversed ranges: if
min is bigger than max it considers values outside ot the max, min range as valid.
$ component install code42day/bounds
or
$ npm install bounds
Sets comparison function. fn
should take 2 arguments and behave like sort comparison function i.e.
return 0 if items are equal, -1 if the first is smaller than the second, 1 is the first is bigger
than the second.
Set lower bound (inclusive) to v
Set upper bound (inclusive) to v
Return true
if v
is in bounds i.e. min <= v <= max
Return true
if v
is outside of bounds i.e. v < min
OR max < v
Return true
if v < min
Return true
if v > max
For regular ranges it's the same as in
. For reversed ranges it considers as valid values that are
outside of the range (it's still inclusive so min
and max
are still considered valid)
Returns the passed value for valid
values. For invalid values returns the closest boundary (min
or max
). restrict
only works for reverse ranges if distance
function is defined.
Optional distance function: it's only used when calculating proper restriction for reversed ranges.
If restricted value is closed to min
than to max
, then the min
is returned.
MIT
FAQs
Mixin for checking if value is inside or outside of bounds
The npm package democracyos-bounds receives a total of 3 weekly downloads. As such, democracyos-bounds popularity was classified as not popular.
We found that democracyos-bounds demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.